/*
 * Created on May 23, 2004
 */
package dk.aiszone.lang.utils;

/**
 * @author <a href="mailto:ais@mail.dk">Ais</a>
 * @since 1.0
 * @version 1.0
 */
public class StringUtils {

    /** The length of the random generated value */
    public static int LENGTH_OF_RANDOM_NAME = 12;

    //stopJesting
    private static final char[] list = new char[] {
            '0',
            '1',
            '2',
            '3',
            '4',
            '5',
            '6',
            '7',
            '8',
            '9',
            'A',
            'B',
            'C',
            'D',
            'E',
            'F',
            'G',
            'H',
            'I',
            'J',
            'K',
            'L',
            'M',
            'N',
            'O',
            'P',
            'Q',
            'R',
            'S',
            'T',
            'U',
            'V',
            'W',
            'X',
            'Y',
            'Z',
            'a',
            'b',
            'c',
            'd',
            'e',
            'f',
            'g',
            'h',
            'i',
            'j',
            'k',
            'l',
            'm',
            'n',
            'o',
            'p',
            'q',
            'r',
            's',
            't',
            'u',
            'v',
            'w',
            'x',
            'y',
            'z' };

    /**
     * Creates a random <code>String</code>.
     * 
     * @return A random generated <code>String</code>
     */
    public static String getRandomName() {
        char randomName[] = new char[LENGTH_OF_RANDOM_NAME];
        randomName[0] = list[(int)(Math.random() * (list.length - 10)) + 10]; // Prevent first character from being a number

        for (int i = 1; i < LENGTH_OF_RANDOM_NAME; i++) {
            randomName[i] = list[(int)(Math.random() * list.length)];
        }
        return new String(randomName);
    }
    //resumeJesting
}